import App from "../App";
import Home from "../view/Home";
import Page from "../view/Page";
import Login from "../view/Login";
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
//BrowserRouter history模式  HashRouter  hash模式
// const baseRouter = () => {
//   return;
//   <BrowserRouter>
//     <Routes>
//       <Route path="/" element={<App></App>}>
//         <Route path="/home" element={<Home></Home>}></Route>
//         <Route path="/about" element={<About></About>}></Route>
//       </Route>
//     </Routes>
//   </BrowserRouter>;
// };

const baseRouter = () => (
  <BrowserRouter>
    <Routes>
      <Route path="/" element={<App></App>}>
        {/* 重定向 Navigate */}
        <Route path="/" element={<Navigate to="home"></Navigate>}></Route>
        {/* <Route path="/login" element={<Login></Login>}></Route> */}
        <Route path="/home" element={<Home></Home>}></Route>
      </Route>
    </Routes>
  </BrowserRouter>
);
export default baseRouter;

